﻿using System;
using Limestone.Fields;

namespace Limestone
{
    public class FieldSettingFactory
    {
        public static IFieldSetting CreateFieldSetting(FieldType fieldType, string name)
        {
            switch (fieldType)
            {
                case FieldType.TextField:
                    var tfld = new TextFieldSetting(name);
                    return tfld;
                case FieldType.ImageField:
                    var ifld = new ImageFieldSetting(name);
                    return ifld;
                case FieldType.FileField:
                    var ffld = new FileFieldSetting(name);
                    return ffld;
                case FieldType.PageField:
                    var pfld = new PageFieldSetting(name);
                    return pfld;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
    }
}
